package com.xzh.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xzh.dao.CourseMapper;
import com.xzh.model.Courses;
import com.xzh.model.search.CourseSearch;
import com.xzh.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {
    private CourseMapper courseMapper;
    @Autowired
    public void setCourseMapper(CourseMapper courseMapper) {
        this.courseMapper = courseMapper;
    }
    @Override
    public Page<Courses> selectAll(Page<Courses> page, Courses courses) {
        return courseMapper.selectAll(page, courses);
    }

    @Override
    public boolean save(Courses courses) {
        return courseMapper.insert(courses) > 0;
    }

    @Override
    public boolean updateById(Courses courses) {
        return courseMapper.updateById(courses) > 0;
    }

    @Override
    public int deleteByIds(List<Integer> ids) {
        return courseMapper.deleteByIds(ids);
    }



}
